<?php
if (!defined("IN_OP"))
{
    exit("You can't access this file directly...");
}

$ui = new UI(true,'',true);
$tpl = new Template_Member();
$tpl->load(array("main" => "6h/bb.tpl", "menu" => "6h/6h_menu.tpl","header"=>"game_header.tpl","foot"=>"game_foot.tpl"));
$tpl->set($fp," class='select'");
$tpl->set('tblName','六合彩');
$tpl->show("menu");
if ($curruser['enabled'] != 1)
{
    $ui->showErrorPage("<p class=error>帐号已被暂停使用</p>");
    exit();
}
$rs = getdb("select * from lotto where open>='" . date("Y-m-d") . "' order by open limit 1");
if ($rs->eof)
{
    $ui->showErrorPage("<div class='time'><div class='timeDiv2'>以官方公告为准</div></div>");
    exit();
}
$open = $rs->f['open'];
$round = $rs->f['round'];
$lotto_id = $rs->f['id'];
$stopbet = $conf->get("stopbet");
if (date("Y-m-d") < $open)
{
    $ui->showErrorPage("<div class='time'><div class='timeDiv2'>以官方公告为准</div></div>");
    exit();
}
else if (date("Y-m-d") == $open)
{
    if ($stopbet <= date("Hi"))
    {
        $ui->showErrorPage("<div class='time'><div class='timeDiv2'>以官方公告为准</div></div>");
        exit();
    }
    else if (date("Hi") <= $conf->get("startbet"))
    {
        $ui->showErrorPage("<p class=error>目前非下单时段</p><script>setTimeout('location.reload()',30000);</script>");
        exit();
    }
}
$tpl->set("cchinayear", intval($conf->get("chinayear")));
$t1 = strtotime($open . " " . $stopbet);
$tpl->Set("timestap", $t1 - systime());
$tpl->set("phptime", systime());
$tpl->set("open", $open);
$tpl->set("round", d3($round));
$tpl->set("lotto_id", $lotto_id);
$tpl->set("betName","半波");
$tpl->set("gametype",0);

$select_disk = getUserValidDiskSelect($curruser, "RefRate()");
$tpl->set("select_disk", $select_disk);
$disk = $g_disk_code[getUserValidDisk( $curruser )];
$rs = getdb( "select * from rate1{$disk} where lotto_id={$lotto_id} LIMIT 1" );
if ( $rs->eof )
{
    $ui->showErrorPage( "<p class=error>系统目前维护中，请稍後！</p>" );
    exit();
}
$k = 1;
$i = 1;
$arr=array("R","B","G");
$number=array(
	array(1,7,13,19,23,29,35,45),
	array(2,8,12,18,24,30,34,40,46),
	array(29,30,34,35,40,45,46),
	array(1,2,7,8,12,13,18,19,23,24),
	array(3,9,15,25,31,37,41,47),
	array(4,10,14,20,26,36,42,48),
	array(25,26,31,36,37,41,42,47,48),
	array(3,4,9,10,14,15,20),
	array(5,11,17,21,27,33,39,43),
	array(6,16,22,28,32,38,44),
	array(27,28,32,33,38,39,43,44),
	array(5,6,11,16,17,21,22)
);
while ( $i <= 3 )
{
    $j = 1;
    while ( $j <= 4 )
    {
		$a=$number[$k-1];
		$cnum="";
		foreach($a as $v)
        $cnum .= "<div class='bColor".$arr[$i-1]."'>".$v."</div>";
        $tpl->set( "num".$i.$j, $cnum );
        ++$k;
        ++$j;
    }
    ++$i;
}
$tpl->show("header");
$tpl->show("main");
$tpl->show("foot");
?>